/*
 * @Author: Mcc
 * @Date: 2024-07-29 10:17:14
 * @LastEditors: 王明明834578987 10266004+wang-mingming-834578987@user.noreply.gitee.com
 * @LastEditTime: 2024-10-15 11:32:31
 * @FilePath: \ft-apply-admin\src\api\applay\trainlist\self.ts
 * @Description: 
 * 
 * Copyright (c) 2024 by Mcc, All Rights Reserved. 
 */
//import type { GetUserInfoModel } from './model/userModel'
import { defHttp } from '@/utils/http/axios'

//import type { ErrorMessageMode } from '@/types/axios'

enum Api {
  selectTrainingNumberPage = '/training/selectTrainingNumberPage',//培训期数列表
  saveTrainingNumber = '/training/saveTrainingNumber',//新增培训期数
  selectUserByRole = '/auth/selectUserByRole',//根据用户角色标识获取用户数组
  updateTrainingNumber = '/training/updateTrainingNumber', // 修改培训期数
  batchUpdateTrainingNumber = '/training/batchUpdateTrainingNumber', // 批量修改期数(培训官,导师)
  selectTrainingNumberDetail = '/training/selectTrainingNumberDetail', // 编辑回显期数详情
  selectCommonConfigDetail = '/config/selectCommonConfigDetail',
  selectTrainingNumberAllList = '/training/selectTrainingNumberAllList' // 获取当前所有的期数(不是递归)
}
//培训列表接口
export function selectTrainingNumberPage(data) {
  return defHttp.post({ url: Api.selectTrainingNumberPage, data })
}
//新增培训
export function saveTrainingNumber(data) {
  return defHttp.post({ url: Api.saveTrainingNumber, data })
}

// 获取角色id
export function selectUserByRole(params) {
  return defHttp.get({ url: Api.selectUserByRole, params })
}

//修改培训期数
export function updateTrainingNumber(data) {
  return defHttp.post({ url: Api.updateTrainingNumber, data })
}


//批量修改培训期数
export function batchUpdateTrainingNumber(data) {
  return defHttp.post({ url: Api.batchUpdateTrainingNumber, data })
}

// 获取角色id
export function selectTrainingNumberDetail(params) {
  return defHttp.get({ url: Api.selectTrainingNumberDetail, params })
}

// 配置
export function selectCommonConfigDetail(params) {
  return defHttp.get({ url: Api.selectCommonConfigDetail, params })
}

//获取当前所有的期数
export function selectTrainingNumberAllList(params){
  return defHttp.get({ url: Api.selectTrainingNumberAllList, params },{ isTransformResponse: false })
}

//删除培训期数
export function deleteTrainingNumber(params){
  return defHttp.post({ url: "/training/deleteTrainingNumber", params })
}

//修改培训期数 上线/下线
export function updateOnlineStatus(params){
  return defHttp.post({ url: "/training/updateOnlineStatus", params })
}